import api from './api'

/**
 * 收藏商品接口
 */
class FavouriteGoodsApi extends api {
  /**
   * 新增收藏
   * @param {*} goodsId 商品id
   * @param {*} nikeName 别名
   */
  addFavourite (goodsId, nikeName) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}`,
      method: 'post',
      data: {
        goodsId,
        nikeName
      }
    })
  }

  /**
   * 删除收藏
   * @param {*} goodsId 商品id
   */
  deleteFavourite (goodsId) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/goods/${goodsId}`,
      method: 'delete'
    })
  }
}

export default new FavouriteGoodsApi('photoStudio/favouriteGoods')
